<html>
<head><meta charset="utf-8"><title>Pin-based intrusive collections · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pin-based.20intrusive.20collections.html">Pin-based intrusive collections</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="180692075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pin-based%20intrusive%20collections/near/180692075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pin-based.20intrusive.20collections.html#180692075">(Nov 14 2019 at 01:39)</a>:</h4>
<p>The Pin docs mention the ability to use Pin to implement safe intrusive collections: <a href="https://doc.rust-lang.org/nightly/std/pin/index.html#example-intrusive-doubly-linked-list" target="_blank" title="https://doc.rust-lang.org/nightly/std/pin/index.html#example-intrusive-doubly-linked-list">https://doc.rust-lang.org/nightly/std/pin/index.html#example-intrusive-doubly-linked-list</a></p>
<p>Anyone know if there's a crate on <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> that actually implements and exposes this?  (<code>futures-intrusive</code> implements it but as a private primitive behind higher-level APIs.)</p>



<a name="180892957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Pin-based%20intrusive%20collections/near/180892957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cormacrelf <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Pin-based.20intrusive.20collections.html#180892957">(Nov 16 2019 at 03:19)</a>:</h4>
<p>Not that I know of. Intrusive-collections doesn’t seem like it would benefit from the pattern — it envisages collections owning the elements, multiple collections working if you use Rc pointers, and if anything elements outliving collections rather than being dropped first (‘scoped collections’). It also doesn’t allow mutable access to fields on your elements. But AFAICT, a linked list using Pin would be feasible to do yourself every time you wanted one. It doesn’t sound too difficult.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>